package app.util;

public class LinearInterpolation {
	public static int interpolate(int x1, int x2, int val1, int val2, int x) {
		return val1 + Math.round((val2 - val1) * (float)(x - x1)/(float)(x2 - x1));
	}
}
